using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.AutionBids;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects 
{
	public static class BO_AutionBids
	{
		public static DataTable SelectAll(int status)
		{
			try
			{
				BOAutionBids_Select_All action = new BOAutionBids_Select_All();
				usp_AutionBids_Select_All entity = new usp_AutionBids_Select_All();
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status)
		{
			try
			{
				BOAutionBids_Select_Top action = new BOAutionBids_Select_Top();
				usp_AutionBids_Select_Top entity = new usp_AutionBids_Select_Top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable Search(int  aution_bid_id)
		{
			try
			{
				BOAutionBids_Search action = new BOAutionBids_Search();
				usp_AutionBids_Search entity = new usp_AutionBids_Search();
				entity.AUTION_BID_ID = aution_bid_id;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
		{
			try
			{
				BOAutionBids_Select_WithPaged action = new BOAutionBids_Select_WithPaged ();
				usp_AutionBids_Select_WithPaged entity = new usp_AutionBids_Select_WithPaged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static string Insert( Int64 aution_id, Int64 member_id, DateTime bid_date, decimal bid_price, string comment, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
		{
			try
			{
				BOAutionBids_Insert action = new BOAutionBids_Insert();
				usp_AutionBids_Insert entity = new usp_AutionBids_Insert();
				entity.AUTION_ID = aution_id;
				entity.MEMBER_ID = member_id;
				entity.BID_DATE = bid_date;
				entity.BID_PRICE = bid_price;
				entity.COMMENT = comment;
				entity.CREATED_DATE = created_date;
				entity.CREATED_BY = created_by;
				entity.MODIFY_DATE = modify_date;
				entity.MODIFY_BY = modify_by;
				entity.STATUS = status;
				return action.ExecuteAndReturnStringValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static string Update( Int64 aution_bid_id, Int64 aution_id, Int64 member_id, DateTime bid_date, decimal bid_price, string comment, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
		{
			try
			{
				BOAutionBids_Update action = new BOAutionBids_Update();
				usp_AutionBids_Update entity = new usp_AutionBids_Update();
				entity.AUTION_BID_ID = aution_bid_id;
				entity.AUTION_ID = aution_id;
				entity.MEMBER_ID = member_id;
				entity.BID_DATE = bid_date;
				entity.BID_PRICE = bid_price;
				entity.COMMENT = comment;
				entity.CREATED_DATE = created_date;
				entity.CREATED_BY = created_by;
				entity.MODIFY_DATE = modify_date;
				entity.MODIFY_BY = modify_by;
				entity.STATUS = status;
				return action.ExecuteAndReturnStringValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static bool Delete(int aution_bid_id)
		{
			try
			{
				BOAutionBids_Delete action = new BOAutionBids_Delete();
				usp_AutionBids_Delete entity = new usp_AutionBids_Delete();
				entity.AUTION_BID_ID = aution_bid_id;
				return action.ExecuteAndReturnBooleanValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static bool Restore(int aution_bid_id)
		{
			try
			{
				BOAutionBids_Restore action = new BOAutionBids_Restore();
				usp_AutionBids_Restore entity = new usp_AutionBids_Restore();
				entity.AUTION_BID_ID = aution_bid_id;
				return action.ExecuteAndReturnBooleanValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}

